package com.fwtai.controller.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.service.web.SmsService;
import com.fwtai.tool.ToolClient;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 短信发送控制层|路由层
 * @作者 田应平
 * @版本 v1.0
 * @QQ号码 444141300
 * @创建日期 2021-11-12 16:16:08
 * @官网 <url>http://www.fwtai.com</url>
*/
@RestController
@RequestMapping("/sms")
public class SmsController{

    @Resource
    private SmsService smsService;

    /**获取数据*/
    @PreAuthorize("hasAuthority('sms_btn_listData')")
    @GetMapping("/listData")
    public void listData(final HttpServletRequest request,final HttpServletResponse response){
        ToolClient.responseJson(smsService.listData(new PageFormData(request)),response);
    }

    /*详情*/
    @PreAuthorize("hasAuthority('sms_row_info')")
    @GetMapping("/listInfo")
    public void listInfo(final HttpServletRequest request,final HttpServletResponse response){
        ToolClient.responseJson(smsService.listInfo(new PageFormData(request)),response);
    }
}